package com.bruce.shop.commons.utils;

import java.util.ArrayList;
import java.util.List;

public class StaticResources {

    private static List<String> staticResourcesList = new ArrayList<>();

    static {
        staticResourcesList.add("css");
        staticResourcesList.add("js");
        staticResourcesList.add("html");
        staticResourcesList.add("png");
        staticResourcesList.add("/backLogin.jsp");
        staticResourcesList.add("/SysUserController/login");
        staticResourcesList.add("/ResourcesController/showImage");
    }

    public static boolean isStaticResources(String uri) {

        // 1.先检查是否登录jsp
        boolean contains = staticResourcesList.contains(uri);
        if (!contains) {
            String suf = uri.substring(uri.lastIndexOf(".") + 1);
            return staticResourcesList.contains(suf); // 通过后缀来判断的
        }
        return true;
    }

}
